<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path;
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script type="text/javascript" charset="UTF-8">var projectPath = "<%= basePath%>";</script>
<script type="text/javascript" src="<%=basePath %>/resource/js/common-css-js.js" charset="UTF-8"></script>
<title>大旗科技有限公司-员工档案-添加员工</title>
<style type="text/css">
	body {
		padding: 10px;
	}
	
	.layui-form-label {
		width: 30px;
		white-space: nowrap;
		text-overflow: ellipsis;
		overflow: hidden;
	}
	
	.layui-input-block {
		margin-left: 70px;
	}
	
</style>
</head>
<body>
	<div class="panel-body" style="padding-bottom: 0px;">
		<form class="layui-form">
			 <input type="hidden" name="empId">
			<div class="layui-form-item">
				<input type="text" name="empName" lay-verify="required|peopleName"
					placeholder="姓名" autocomplete="off" class="layui-input">
			</div>
			<div class="layui-form-item">
				<input type="text" name="empAge" lay-verify="required|intNumber"
					placeholder="年龄" autocomplete="off" class="layui-input">
			</div>
			<div class="layui-form-item">
				<select name="empSex" lay-verify="required">
					<option value="男" select>男</option>
					<option value="女">女</option>
				</select>
			</div>
			<div class="layui-form-item">
				<input type="text" name="empDomicilePlace" required
					lay-verify="required" placeholder="户籍所在地" autocomplete="off"
					class="layui-input">
			</div>
			<div class="layui-form-item">
				<input type="text" name="empNativePlace" required
					lay-verify="required|chineseStr" placeholder="籍贯"
					autocomplete="off" class="layui-input">
			</div>
			<div class="layui-form-item">
				<input type="text" name="empMarriage" required
					lay-verify="required|chineseStr" placeholder="婚姻"
					autocomplete="off" class="layui-input">
			</div>
			<div class="layui-form-item">
				<input id="empBirthDay" type="text" name="empBirthDay" required
					lay-verify="required|birthday" placeholder="出生年月"
					autocomplete="off" class="layui-input">
			</div>
			<div class="layui-form-item">
				<input type="text" name="empCard" required
					lay-verify="required|identity" placeholder="身份证号码"
					autocomplete="off" class="layui-input">
			</div>
			<div class="layui-form-item">
				<select name="empWorkState" lay-verify="required">
					<option value="在职">在职</option>
					<option value="请假">请假</option>
					<option value="离职">离职</option>
				</select>
			</div>
			<div class="layui-form-item">
				<select name="empEducation" lay-verify="required">
					<option value="无">请选择</option>
					<option value="初中">初中</option>
					<option value="高中/中专">高中/中专</option>
					<option value="大专">大专</option>
					<option value="本科">本科</option>
					<option value="硕士">硕士</option>
					<option value="博士">博士</option>
				</select>
			</div>
			<div class="layui-form-item">
				<input type="text" name="empPhone" lay-verify="phone"
					placeholder="手机号码" autocomplete="off" class="layui-input">
			</div>
			<div class="layui-form-item">
				<input id="empEntryDate" type="text" name="empEntryDate"
					lay-verify="date" placeholder="入职时间" autocomplete="off"
					class="layui-input">
			</div>
			<div class="layui-form-item">
				<input id="empQuitDate" type="text" name="empQuitDate"
					lay-verify="birthday" placeholder="离职时间" autocomplete="off"
					class="layui-input">
			</div>
			<div class="layui-form-item">
				<select name="empType" lay-verify="required">
					<option value="临时工" select>临时</option>
					<option value="长期工">长期</option>
				</select>
			</div>
			<div class="layui-form-item">
				<input type="text" name="empDomicileCity"
					required lay-verify="required" placeholder="现居住地"
					autocomplete="off" class="layui-input">
			</div>
			<div class="layui-form-item">
				<input type="text" name="empDomicileAddress"
					required lay-verify="required" placeholder="户籍地址详细"
					autocomplete="off" class="layui-input">
			</div>
			<div class="layui-form-item">
				<select name="empRole" lay-verify="required">
				</select>
			</div>
			<div class="layui-form-item">
				<select name="empDepartment" lay-verify="required">
				</select>
			</div>
			<%@include file="/admin/commonsPage/submit-reset.html" %>
		</form>
	</div>
	<script type="text/javascript">
		var rows = parent.cTable.bootstrapTable('getSelections'); 
		laydate.render({
			elem : '#empBirthDay,#empEntryDate,#empQuitDate' //指定元素
		});
		/*---------------------------回显值------------------------------------*/
		renderSelectOption($("select[name='empRole']"),"/role",rows[0].empRole);
		renderSelectOption($("select[name='empDepartment']"),"/department",rows[0].empDepartment);
		
		for(key in rows[0]){
			$("input[name='"+key+"']").val(rows[0][key]);
			$("option:contains('"+rows[0][key]+"')").attr("selected",true);
		}
		/*---------------------------回显值------------------------------------*/
		requestUpdateData("/human-resource/staff-files");
	</script>
</body>
</html>